package com.tywj.panda.driver.entity

import android.os.Parcel
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import com.tywj.lib.businessweak.entity.AbsPagingEntity

/**
 * @desc 任务实体类
 * @author June Yang
 * @date 2020/6/20
 */
class DriverTaskEntity : AbsPagingEntity<DriverTaskEntity.DataBean>() {
    class DataBean() : Parcelable {

        var id = ""

        /**
         * 班次编号
         */
        @SerializedName("store_no")
        var storeNo = ""

        @SerializedName("line_code")
        var lineCode = ""

        /**
         *车辆编号
         */
        @SerializedName("vehicle_code")
        var vehicleCode = ""

        /**
         *车牌号
         */
        @SerializedName("vehicle_no")
        var vehicleNo = ""

        /**
         * 发车时间 6:30
         */
        @SerializedName("line_time")
        var lineTime = ""

        /**
         * 验票数
         */
        @SerializedName("inspect_ticket_num")
        var inspectTicketNum = ""

        /**
         * 乘客数
         */
        @SerializedName("assign_seate_no")
        var assignSeateNo = ""

        /**
         * 打卡标记（0：未打卡，1：打卡，2：缺卡）
         */
        @SerializedName("punch_flag")
        var punchFlag = 0

        //1 车的状态开始状态，2 结束打卡 3 已完成
        var status = 1

        /**
         * 线路名称
         */
        @SerializedName("line_name")
        var lineName = ""

        @SerializedName("line_date")
        var lineDate = ""

        @SerializedName("create_time")
        var createTime = ""

        /**
         * 开始打卡时间
         */
        @SerializedName("start_work")
        var startWork = ""

        /**
         * 开始打卡标记
         */
        @SerializedName("start_punch")
        var startPunch = 0

        /**
         * 结束打卡时间
         */
        @SerializedName("end_work")
        var endWork = ""

        /**
         * 结束打卡标记
         */
        @SerializedName("end_punch")
        var endPunch = 0

        constructor(parcel: Parcel) : this() {
            id = parcel.readString() ?: ""
            storeNo = parcel.readString() ?: ""
            lineCode = parcel.readString() ?: ""
            vehicleCode = parcel.readString() ?: ""
            vehicleNo = parcel.readString() ?: ""
            lineTime = parcel.readString() ?: ""
            inspectTicketNum = parcel.readString() ?: ""
            assignSeateNo = parcel.readString() ?: ""
            punchFlag = parcel.readInt()
            status = parcel.readInt()
            lineName = parcel.readString() ?: ""
            lineDate = parcel.readString() ?: ""
            createTime = parcel.readString() ?: ""
            startWork = parcel.readString() ?: ""
            startPunch =  parcel.readInt()
            endWork = parcel.readString() ?: ""
            endPunch = parcel.readInt()
        }

        override fun writeToParcel(dest: Parcel, flags: Int) {
            dest.writeString(id)
            dest.writeString(storeNo)
            dest.writeString(lineCode)
            dest.writeString(vehicleCode)
            dest.writeString(vehicleNo)
            dest.writeString(lineTime)
            dest.writeString(inspectTicketNum)
            dest.writeString(assignSeateNo)
            dest.writeInt(punchFlag)
            dest.writeInt(status)
            dest.writeString(lineName)
            dest.writeString(lineDate)
            dest.writeString(createTime)
            dest.writeString(startWork)
            dest.writeInt(startPunch)
            dest.writeString(endWork)
            dest.writeInt(endPunch)
        }

        override fun describeContents(): Int = 0

        companion object CREATOR : Parcelable.Creator<DataBean> {
            override fun createFromParcel(parcel: Parcel): DataBean {
                return DataBean(parcel)
            }

            override fun newArray(size: Int): Array<DataBean?> {
                return arrayOfNulls(size)
            }
        }
    }
}